package com.aids_malaria.http.response.register;

public class RegistResponse<T> {
    private String code;
    private String message;
    private T data;
    private String datasize;
    //        100注册成功 200 注册不成功 300 已注册
    private static final String CODE_SUCCESS = "100";//成功的code
    private static final String REGISTERERROR = "200";//
    private static final String REGISTERED = "300";//

    /**
     * 是否请求数据成功
     *
     * @return
     */
    public boolean isSuccess() {
        return CODE_SUCCESS.equals(getCode());
    }

    /**
     * 是否注册不成功
     *
     * @return
     */
    public boolean isRegisterFalure() {
        return REGISTERERROR.equals(getCode());
    }

    /*
    * 是否已注册
     */
    public boolean isRegistered() {
        return REGISTERED.equals(getCode());
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getDatasize() {
        return datasize;
    }

    public void setDatasize(String datasize) {
        this.datasize = datasize;
    }
}
